<?php 

// $Id$
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
/**
 * Function used to display an horizontal menu inside the admin panel
 *
 * Enable webmasters to navigate thru the module's features.
 * Each time you select an option in the admin panel of the news module, this option is highlighted in this menu
 *
 * @package News
 * @author - stolen to the Newbb team ;-)
 * @copyright	(c) The Xoops Project - www.xoops.org
*/


function groovyMenu($currentoption = 0, $breadcrumb = ''){
global $modversion, $adminmenu, $xoopsDB, $xoopsConfig, $xoopsModule;

	echo "<div id='buttontop' style='background-color:#E7E7E7; border:lpx solid #000000; '>"; 
	echo "<table style='width: 100%;padding-bottom:15px;' cellspacing='0'><tr>";
	echo "<td style=\"width: 60%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\">"; if(isset($modversion['config'])){echo"<a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=".$xoopsModule->getVar('mid')."\">Preferences</a> | ";} echo"<a href=\"../index.php\">Go to module</a>"; if(isset($modversion['hasHelp']) && $modversion['hasHelp']==1){echo"| <a href=\"".$modversion['helpUrl']."\">Help</a>";} echo "</td>";
	echo "<td style=\"width: 40%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;\"><b>" . $xoopsModule->name() . "  </b> " . $breadcrumb . "</td>";
	echo "</tr></table>";

function catchTab($i,$currentoption){
	if($i == $currentoption){
		return 'true';
	}else{
		return 'false';
	}
}
	
echo "<div id='mainTabContainer' executeScripts='true' dojoType='dijit.layout.TabContainer'  refreshOnShow='true'  style='z-index: 0;height: 475px;background-color:#E7E7E7;border-bottom:1px solid black' selectedChild='tab$currentoption' >";
	for($i=0; $i<count($adminmenu); ++$i){
		echo"<div id='tab$i' preventCache='true' refreshOnShow='false' dojoType='dijit.layout.ContentPane' href='".XOOPS_URL."/modules/".$modversion['dirname']."/admin/includes/".substr($adminmenu[$i]['link'],strpos($adminmenu[$i]['link'], '=')+1, (strpos($adminmenu[$i]['link'], '&') - strpos($adminmenu[$i]['link'], '='))-1 )."' title='" . $adminmenu[$i]['title'] . "' selected='".catchTab($i,$currentoption)."'></div>";
	}
echo"</div>";
}

?>
